constcat
std::concat!
with support for const
variables and expressions.
Works on stable Rust ✨.
🚀 Getting started
Add constcat
to your Cargo manifest.
Import the macro using the following.
use concat;
🤸 Usage
concat!
works exactly like std::concat!
except you can
now pass variables and constant expressions. For example:
const CRATE_NAME: &str = env!;
const CRATE_VERSION: &str = env!;
const
const VERSION: &str = concat!;
concat_bytes!
works similarly except it yields a static byte slice. For
example:
const VERSION: u32 = 1;
const
const HEADER: & = concat_bytes!;
License
This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.